<?php
class XMLModel {
	/**
	 * バリューオブジェクト
	 *
	 * @var SimpleXMLElement
	 */
	protected $VO = null;
	/**
	 * 要素の名前
	 *
	 * @var string
	 */
	protected $element = '';
	/**
	 * コンストラクタ
	 *
	 * @param SimpleXMLElement $modelVO
	 */
	public function __construct($modelVO, $modelElementName) {
		$this->VO = $modelVO;
		$this->element = $modelElementName;
	}
	public function add(SimpleXMLElement $srcElem, $xslFile) {
		$tree = new Transformer($xslFile);
		return $tree->execute($srcElem, $this->VO);
	}
	public function del($index) {
		$elemName = $this->element;
		$target = $this->VO->$elemName;
		unset($target[$index]);
	}
}
